home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJLSR106.ARJ / SCANF.C < prev    next >
C/C++ Source or Header  |  1992-03-02  |  810b  |  35 lines

  1. /* This is file SCANF.C */
  2. /* This file may have been modified by DJ Delorie (Jan 1991).  If so,
  3. ** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave,
  4. ** Rochester NH, 03867-2954, USA.
  5. */
  6.  
  7. #if defined(LIBC_SCCS) && !defined(lint)
  8. static char sccsid[] = "@(#)scanf.c    5.2 (Berkeley) 3/9/86";
  9. #endif LIBC_SCCS and not lint
  10.  
  11. #include    <stdio.h>
  12.  
  13. scanf(const char *fmt, ...)
  14. {
  15.     return(_doscan(stdin, fmt, (&fmt)+1));
  16. }
  17.  
  18. fscanf(FILE *iop, const char *fmt, ...)
  19. {
  20.     return(_doscan(iop, fmt, (&fmt)+1));
  21. }
  22.  
  23. sscanf(char *str, const char *fmt, ...)
  24. {
  25.     FILE _strbuf;
  26.  
  27.     _strbuf._flag = _IOREAD|_IOSTRG;
  28.     _strbuf._ptr = _strbuf._base = str;
  29.     _strbuf._cnt = 0;
  30.     while (*str++)
  31.         _strbuf._cnt++;
  32.     _strbuf._bufsiz = _strbuf._cnt;
  33.     return(_doscan(&_strbuf, fmt, (&fmt)+1));
  34. }
  35.